package com.marvels.financial.collection.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.financial.collection.dao.CollectStatisticalDao;
import com.marvels.financial.collection.dto.CollectStatisticalParamDTO;
import com.marvels.financial.collection.dto.CollectStatisticalResultDTO;
import com.marvels.financial.collection.service.CollectStatisticalService;

/**
 * 催收统计
 * @author 吴俊峰
 */
@Service
public class CollectStatisticalServiceImpl implements CollectStatisticalService {

	@Autowired
	private CollectStatisticalDao collectStatisticalDao;
	
	@Override
	public List<CollectStatisticalResultDTO> queryList(CollectStatisticalParamDTO dto) throws MarvelsBusinessException {
		try {
			if(dto.getQueryDate() == null){
				throw new MarvelsBusinessException("查询日期不能为空");
			}
			PageHelper.startPage(dto.getPageNo(), dto.getPageSize());
			return collectStatisticalDao.queryList(dto);
		} catch (Exception e) {
			throw new MarvelsBusinessException(e);
		}
	}

}
